 @extends('layouts.admin_common') @section('content')


<div class="breadcrumbs_container">{{
	Breadcrumbs::render('admin.supplier_master') }}</div>
<div class="system_tab_line"></div>

<form class="form-inline" id="supplierForm" method="post">

	<script>
    function onSubmit(op){

		var flag = false;

        if (document.getElementById('supplier_name').value==''){
        	alert("会社名を入力してください。");
        	return;
        }

    	//if(flag){
            var form = document.getElementById('supplierForm');
            form.action="../supplier/"+op;
            form.submit();
    	  //}
        }
    function reBack(){
    	window.location.href=('../supplier');
	}
    function goBack(){
    	window.history.go(-1);
    }
    function onCheckNull() {
		var inputEle = document.getElementsByTagName('input');
		for (i = 0; i < inputEle.length; i++) {
			if (inputEle[i].checked && inputEle[i].value == "") {
				alert(inputEle[i].placeholder + "を入力してください。");
				return false;
			}
		}
		return true;
	}
    function onCheckEmail(obj) {
		if (obj.value != "") {
			var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;

			if (!myreg.test(obj.value)) {
				alert('Emailを正しく入力してください。');
				return false;
			}
		}
		return true;
	}
	function onCheckPhone(obj) {
		if(obj.value!=""){
		var myreg = /^[\d-]*$/;

		if (!myreg.test(obj.value)) {
			alert('TELを正しく入力してください。');
			return false;
		}
		}
		return true;
	}
    </script>
	<script src="https://ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>
	<table class="table table-condensed">
		<col width="160px">
		<col width="*">
		<col width="160px">
		<col width="*">
		<tr>
			<td>会社名</td>
			<td><input type="text" checked="checked" class="form-control"
				style="width: 95%; margin-right: 5px;" placeholder="会社名"
				name="SupplierMaster[supplier_name]" id="supplier_name"
				value="{{$supplierInfo->supplier_name}}"> *</td>
		</tr>
		<tr>
			<td>会社名カナ</td>
			<td><input type="text" checked="checked" class="form-control"
				style="width: 95%; margin-right: 5px;" placeholder="会社名カナ"
				name="SupplierMaster[supplier_catelogue]"
				value="{{$supplierInfo->supplier_catelogue}}"> *</td>
		</tr>
		<tr>
			<td>郵便番号</td>
			<td><input type="text" checked="checked" class="form-control"
				placeholder="郵便番号" name="SupplierMaster[supplier_postcode]"
				onblur="AjaxZip3.zip2addr(this,'','SupplierMaster[supplier_adress]','SupplierMaster[supplier_adress]');"
				value="{{$supplierInfo->supplier_postcode}}"> *数字、"-"を組み合わせて入力してください</td>
		</tr>
		<tr>
			<td>住所</td>
			<td><input type="text" checked="checked" class="form-control"
				style="width: 95%; margin-right: 5px;" placeholder="住所"
				name="SupplierMaster[supplier_adress]"
				value="{{$supplierInfo->supplier_adress}}"> *</td>
		</tr>
		<tr>
			<td>住所(ビル名)</td>
			<td><input type="text" checked="checked" class="form-control"
				style="width: 95%; margin-right: 5px;" placeholder="住所(ビル名)"
				name="SupplierMaster[supplier_biru_name]"
				value="{{$supplierInfo->supplier_adress}}"> *</td>
		</tr>
		<tr>
			<td>会社TEL</td>
			<td><input type="text" checked="checked" id="corpTel"
				class="form-control" placeholder="会社TEL"
				name="SupplierMaster[supplier_tel]"
				value="{{$supplierInfo->supplier_tel}}"> *数字、"-"を組み合わせて入力してください</td>
			<td>会社FAX</td>

			<td><input type="text" checked="checked" id="corpFax"
				class="form-control" placeholder="会社FAX"
				name="SupplierMaster[supplier_fax]"
				value="{{$supplierInfo->supplier_fax}}"> *数字、"-"を組み合わせて入力してください</td>
		</tr>
		<tr>
			<td>代表Mail</td>
			<td><input type="text" checked="checked" id="supplierMail"
				class="form-control" placeholder="代表Mail"
				name="SupplierMaster[supplier_mail]"
				value="{{$supplierInfo->supplier_mail}}"> *</td>
		</tr>
		<tr>
			<td>代表担当者</td>
			<td><input type="text" checked="checked" class="form-control"
				placeholder="代表担当者" name="SupplierMaster[supplier_stuff]"
				value="{{$supplierInfo->supplier_stuff}}"> *</td>
			<td>担当Tel</td>

			<td><input type="text" checked="checked" id="supplierStuffTel"
				class="form-control" placeholder="担当Tel"
				name="SupplierMaster[supplier_stuff_telephone]"
				value="{{$supplierInfo->supplier_stuff_telephone}}">
				*数字、"-"を組み合わせて入力してください</td>


		<tr>


		<tr>
			<td>担当者カナ</td>
			<td><input type="text" checked="checked" class="form-control"
				placeholder="担当者カナ" name="SupplierMaster[stuff_kana]"
				value="{{$supplierInfo->stuff_kana}}"> *</td>
			<td>担当Mail</td>
			<td><input type="text" checked="checked" id="stuffMail"
				class="form-control" placeholder="担当Mail"
				name="SupplierMaster[stuff_mail]"
				value="{{$supplierInfo->stuff_mail}}"> *</td>


		<tr>

	</table>
	<table class="table table-condensed">
		<tr>
			<td><input type="button" value="保存"
				class="btn btn-primary button_normal" onclick="onSubmit('create')" /></td>
			<td><input type="button" value="キャンセル"
				class="btn btn-primary button_normal" onclick="reBack()" /></td>
			<td><input type="button" value="削除"
				class="btn btn-primary button_normal" onclick="onSubmit('delete')" " /></td>
		</tr>
	</table>
	<input type="hidden" class="form-control" placeholder=""
		name="SupplierMaster[supplier_id]"
		value="{{$supplierInfo->supplier_id}}"> <input type="hidden"
		name="_token" id="csrf-token" value="{{ Session::token() }}" />
</form>
@endsection
